local skynet = require "skynet"
local sprotoloader = require "sprotoloader"

local proto = require "common.proto"

local loader = {
	GAME_TYPES = 0,

	GAME = 1,
	GAME_C2S = 1,
	GAME_S2C = 2,
}

skynet.start(function()
	sprotoloader.save(proto.c2s, 1)
	sprotoloader.save(proto.s2c, 2)
end)

-- function loader.init ()
-- 	sprotoloader.save (gamep.c2s, loader.GAME_C2S)
-- 	sprotoloader.save (gamep.s2c, loader.GAME_S2C)
-- end

-- function loader.load (index)
-- 	local host = sprotoloader.load (index):host "package"
-- 	local request = host:attach (sprotoloader.load (index + 1))
-- 	return host, request
-- end

-- return loader
